package com.xuanyue.db.xuan.core.table.expr;

public class SortTemplate implements IExprKey{
	/** 普通 */
	public final static int GENERAL=1;//general
	/** 数组 */
	public final static int ARRAY=2;
	/** MAP */
	public final static int MAP=3; 
	
	private String cname;
	private int[] arryIndex;
	private String key;
	
	private boolean isDesc;

	public String getCname() {
		return cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	public int[] getArryIndex() {
		return arryIndex;
	}

	public void setArryIndex(int[] arryIndex) {
		this.arryIndex = arryIndex;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public boolean isDesc() {
		return isDesc;
	}

	public void setDesc(boolean isDesc) {
		this.isDesc = isDesc;
	}
	
	public boolean isType(int type) {
		if(type==1) {
			return key==null&&arryIndex==null;
		}else if(type==2) {
			return key==null&&arryIndex!=null;
		}else if(type==3) {
			return key!=null&&arryIndex==null;
		}else {
			return false;
		}
	}
	
}
